package com.pro.common.api.enums.init;

import com.pro.common.api.enums.EnumSysRole;
import com.pro.framework.api.enums.EnumToDbEnum;
import com.pro.framework.api.enums.IEnumStr;
import com.pro.framework.api.enums.IEnumToDbEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.math.BigDecimal;
import java.util.Map;

@Schema(description = "货币")
@Getter
@AllArgsConstructor
@EnumToDbEnum(entityClass = "com.pro.common.service.sitecontent.model.db.Currency")
public enum EnumCurrency implements IEnumToDbEnum {
    CNY(null, "人民币", "人民币", "¥", BigDecimal.valueOf(7.2), "Asia/Shanghai", "Chinese Yuan", EnumCountry.CHN, "CHN", 800, true, true, null),
    USD(null, "美元", "Dollar", "$", BigDecimal.valueOf(1), "America/New_York", "United States Dollar", EnumCountry.USA, "USA,PRI,UMI,GUM,ASM,VIR,MNP", 100, true, true, null),
    EUR(null, "欧元", "Euro", "€", BigDecimal.valueOf(0.85), "Europe/Berlin", "Euro", EnumCountry.DEU, "DEU,FRA,ITA,ESP,NLD,BEL,AUT,GRC,PRT,FIN,IRL,LUX,EST,LTU,LVASVN,MLT,HRV,CYP,AND,MCO,SMR,VAT", 200, false, true, null),
    JPY(null, "日元", "日本円", "¥", BigDecimal.valueOf(110.0), "Asia/Tokyo", "Japanese Yen", EnumCountry.JPN, "JPN", 300, false, true, null),
    GBP(null, "英镑", "Pound", "£", BigDecimal.valueOf(0.75), "Europe/London", "Pound Sterling", EnumCountry.GBR, "GBR,GGY,JEY,IMN", 400, false, true, null),
    AUD(null, "澳元", "A$", "A$", BigDecimal.valueOf(1.35), "Australia/Sydney", "Australian Dollar", EnumCountry.AUS, "AUS,CXR,CCK,HMD,KIR,NIU,NFK,TUV", 500, false, true, null),
    CAD(null, "加元", "C$", "C$", BigDecimal.valueOf(1.25), "America/Toronto", "Canadian Dollar", EnumCountry.CAN, "CAN", 600, false, true, null),
    CHF(null, "瑞士法郎", "Franken", "CHF", BigDecimal.valueOf(0.92), "Europe/Zurich", "Swiss Franc", EnumCountry.CHE, "CHE,LIE", 700, false, true, null),
    SEK(null, "瑞典克朗", "Krona", "kr", BigDecimal.valueOf(8.5), "Europe/Stockholm", "Swedish Krona", EnumCountry.SWE, "SWE", 900, false, true, null),
    NZD(null, "新西兰元", "NZ$", "NZ$", BigDecimal.valueOf(1.42), "Pacific/Auckland", "New Zealand Dollar", EnumCountry.NZL, "NZL,COK,NIU,TKL", 1000, false, true, null),
    NOK(null, "挪威克朗", "Krone", "kr", BigDecimal.valueOf(8.8), "Europe/Oslo", "Norwegian Krone", EnumCountry.NOR, "NOR,SJM,BVT", 1100, false, true, null),
    HKD(null, "港元", "港幣", "HK$", BigDecimal.valueOf(7.8), "Asia/Hong_Kong", "Hong Kong Dollar", EnumCountry.HKG, "HKG", 1200, false, true, null),
    SGD(null, "新加坡元", "元", "S$", BigDecimal.valueOf(1.36), "Asia/Singapore", "Singapore Dollar", EnumCountry.SGP, "SGP", 1300, false, true, null),
    KRW(null, "韩元", "원", "₩", BigDecimal.valueOf(1100.0), "Asia/Seoul", "South Korean Won", EnumCountry.KOR, "KOR", 1400, false, true, null),
    INR(null, "印度卢比", "रुपया", "₹", BigDecimal.valueOf(74.0), "Asia/Kolkata", "Indian Rupee", EnumCountry.IND, "IND,BUT", 1500, false, true, null),
    BRL(null, "巴西雷亚尔", "Real", "R$", BigDecimal.valueOf(5.3), "America/Sao_Paulo", "Brazilian Real", EnumCountry.BRA, "BRA", 1600, false, true, null),
    ZAR(null, "南非兰特", "Rand", "R", BigDecimal.valueOf(15.0), "Africa/Johannesburg", "South African Rand", EnumCountry.ZAF, "ZAF,NAM", 1700, false, true, null),
    MXN(null, "墨西哥比索", "Peso", "$", BigDecimal.valueOf(20.0), "America/Mexico_City", "Mexican Peso", EnumCountry.MEX, "MEX", 1800, false, true, null),
    RUB(null, "俄罗斯卢布", "Рубль", "₽", BigDecimal.valueOf(75.0), "Europe/Moscow", "Russian Ruble", EnumCountry.RUS, "RUS,ABH,OST", 1900, false, true, null),
    AED(null, "阿联酋迪拉姆", "درهم", "د.إ", BigDecimal.valueOf(3.67), "Asia/Dubai", "United Arab Emirates Dirham", EnumCountry.ARE, "ARE", 2000, false, true, null),
    MYR(null, "马来西亚林吉特", "Ringgit", "RM", BigDecimal.valueOf(4.2), "Asia/Kuala_Lumpur", "Malaysian Ringgit", EnumCountry.MYS, "MYS", 2100, false, true, null),
    IDR(null, "印尼盾", "Rupiah", "Rp", BigDecimal.valueOf(14000.0), "Asia/Jakarta", "Indonesian Rupiah", EnumCountry.IDN, "IDN", 2200, false, true, null),
    THB(null, "泰铢", "บาท", "฿", BigDecimal.valueOf(33.0), "Asia/Bangkok", "Thai Baht", EnumCountry.THA, "THA", 2300, false, true, null),
    PLN(null, "波兰兹罗提", "Złoty", "zł", BigDecimal.valueOf(4.0), "Europe/Warsaw", "Polish Zloty", EnumCountry.POL, "POL", 2400, false, true, null),
    DKK(null, "丹麦克朗", "Krone", "kr", BigDecimal.valueOf(6.3), "Europe/Copenhagen", "Danish Krone", EnumCountry.DNK, "DNK,FRO,GRL", 2500, false, true, null),
    COP(null, "哥伦比亚比索", "Peso", "$", BigDecimal.valueOf(3700.0), "America/Bogota", "Colombian Peso", EnumCountry.COL, "COL", 2600, false, true, null),
    PEN(null, "秘鲁新索尔", "Sol", "S/.", BigDecimal.valueOf(4.0), "America/Lima", "Peruvian Nuevo Sol", EnumCountry.PER, "PER", 2700, false, true, null),
    EGP(null, "埃及镑", "جنيه", "ج.م", BigDecimal.valueOf(15.7), "Africa/Cairo", "Egyptian Pound", EnumCountry.EGY, "EGY", 2800, false, true, null),
    ARS(null, "阿根廷比索", "Peso", "$", BigDecimal.valueOf(100.0), "America/Argentina/Buenos_Aires", "Argentine Peso", EnumCountry.ARG, "ARG", 2900, false, true, null),
    CLP(null, "智利比索", "Peso", "$", BigDecimal.valueOf(800.0), "America/Santiago", "Chilean Peso", EnumCountry.CHL, "CHL", 3000, false, true, null),
    SAR(null, "沙特里亚尔", "Saudi Riyal", "ر.س", BigDecimal.valueOf(3.75), "Asia/Riyadh", "Saudi Riyal", EnumCountry.SAU, "SAU", 800, false, true, null),
    // 土耳其里拉
    TRY(null, "土耳其里拉", "Türk Lirası", "₺", BigDecimal.valueOf(18.5), "Europe/Istanbul", "Turkish Lira", EnumCountry.TUR, "TUR", 3100, false, true, null),

    // 匈牙利福林
    HUF(null, "匈牙利福林", "Forint", "Ft", BigDecimal.valueOf(297.0), "Europe/Budapest", "Hungarian Forint", EnumCountry.HUN, "HUN", 3200, false, true, null),

    // 捷克克朗
    CZK(null, "捷克克朗", "Koruna", "Kč", BigDecimal.valueOf(21.5), "Europe/Prague", "Czech Koruna", EnumCountry.CZE, "CZE", 3300, false, true, null),

    // 以色列谢克尔
    ILS(null, "以色列谢克尔", "שקל", "₪", BigDecimal.valueOf(3.48), "Asia/Jerusalem", "Israeli Shekel", EnumCountry.ISR, "ISR", 3400, false, true, null),

    // 菲律宾比索
    PHP(null, "菲律宾比索", "Piso", "₱", BigDecimal.valueOf(55.0), "Asia/Manila", "Philippine Peso", EnumCountry.PHL, "PHL", 3500, false, true, null),

    // 巴基斯坦卢比
    PKR(null, "巴基斯坦卢比", "روپیہ", "₨", BigDecimal.valueOf(280.0), "Asia/Karachi", "Pakistani Rupee", EnumCountry.PAK, "PAK", 3600, false, true, null),

    // 越南盾
    VND(null, "越南盾", "Đồng", "₫", BigDecimal.valueOf(23400.0), "Asia/Ho_Chi_Minh", "Vietnamese Dong", EnumCountry.VNM, "VNM", 3700, false, true, null),

    // 科威特第纳尔
    KWD(null, "科威特第纳尔", "دينار", "د.ك", BigDecimal.valueOf(0.31), "Asia/Kuwait", "Kuwaiti Dinar", EnumCountry.KWT, "KWT", 3800, false, true, null),

    // 卡塔尔里亚尔
    QAR(null, "卡塔尔里亚尔", "ريال", "ر.ق", BigDecimal.valueOf(3.64), "Asia/Qatar", "Qatari Riyal", EnumCountry.QAT, "QAT", 3900, false, true, null),

    // 巴林第纳尔
    BHD(null, "巴林第纳尔", "دينار", "ب.د", BigDecimal.valueOf(0.38), "Asia/Bahrain", "Bahraini Dinar", EnumCountry.BHR, "BHR", 4000, false, true, null),

    // 阿曼里亚尔
    OMR(null, "阿曼里亚尔", "ريال عماني", "ر.ع.", BigDecimal.valueOf(0.38), "Asia/Muscat", "Omani Rial", EnumCountry.OMN, "OMN", 4100, false, true, null),

    // 斯里兰卡卢比
    LKR(null, "斯里兰卡卢比", "රුපියල්", "Rs", BigDecimal.valueOf(320.0), "Asia/Colombo", "Sri Lankan Rupee", EnumCountry.LKA, "LKA", 4200, false, true, null)

    ;

    private final String icon;
    private final String cname;
    private final String currencyName;  // 本地语言名称
    private final String symbol;
    private final BigDecimal usdToCurrentRate;
    private final String zoneCode;
    private final String enName;
    private final EnumCountry country;  // 主要国家
    private final String countries; // 使用该货币的国家代码列表，逗号分隔
    private final Integer sort;
    private final Boolean enabled;
    private final Boolean showAdmin;
    private final String forceChangeTime;

    @Override
    public String getLabel() {
        return cname;
    }
    public static final Map<String, EnumCurrency> MAP = IEnumStr.getMap(values());
}